{% block match_metric_block %}
<!--
# @added 20201212 - Feature #3880: webapp - utilities - match_metric
 -->
<!-- BEGIN /utilities match_metric block -->
{% if print_debug == 'True' %}
<code> DEBUG </code> :: /utilities match_metric_block</br>
{% endif %}

{% if display_message %}
<code> ERROR </code></br>
<code> message </code>: {{ display_message }}<br>
{% endif %}

<div class="navbar-header" role="navigation">
  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
  </button>
		<ul class="nav nav-tabs" role="view_tablist" id="view">
		  <li class="active"><a href="/utilities"><span class="logo"><span class="sky">Match</span> <span class="re">metric name</span></span></a></li>
		</ul>
		<div class="tab-content">
	  	<div class="tab-pane active" id="view">
	<br>
  <div class="navbar-header" role="navigation">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
  </div>

	<div class="col-md-12">

	  <h4><span class="logo"><span class="sky">Match ::</span> <span class="re">metric name</span></span> (using the internal <code>matched_or_regexed_in_list</code> function)</h4>

  {% if match_metric %}
    {% if pattern_match %}
	  <div class="alert alert-success">
	    <strong>metric</strong> :: {{ metric }}<br>
	    <strong>settings_list</strong> :: {{ settings_list }}<br>
	    <strong>match_with</strong> :: {{ match_with }}<br>
	    <strong>Matched</strong> :: {{ pattern_match }}<br>
	    <strong>Matched by</strong> :: {{ matched_by }}<br>
	  </div>
    {% else %}
	  <div class="alert alert-danger">
	    <strong>metric</strong> :: {{ metric }}<br>
	    <strong>settings_list</strong> :: {{ settings_list }}<br>
	    <strong>match_with</strong> :: {{ match_with }}<br>
	    <strong>matched</strong> :: {{ pattern_match }}<br>
	    <strong>matched_by</strong> :: {{ matched_by }}<br>
	  </div>
    {% endif %}
  {% endif %}
	  <div class="alert alert-warning">
	    Using a regex in the <code>Match with</code> input field may not have the expected results as there seems to possibly be an encoding issue.<br>
	  </div>
        <form action="match_metric" method=post enctype=multipart/form-data>
  		  <table class="table table-hover">
  		    <thead>
  		      <tr>
  		        <th>Option</th>
  		        <th>value</th>
  		      </tr>
  		    </thead>
  		    <tbody>
  		      <tr>
  		        <td>Metric</td>
  		        <td><input type="text" name="metric" value="" /> the metric name or namespace you want to test e.g. webserver-1.nginx.status_code.200</td>
  		      </tr>
  		      <tr>
  		        <td>Match settings list</td>
  		        <td><input type="text" name="settings_list" value="" /> the settings list item you want to test against e.g SKIP_LIST</td>
  		      </tr>
  		      <tr>
  		        <td>Match with</td>
  		        <td><input type="text" name="match_with" value="" />
              You can manually enter a pattern you wish to test e.g. nginx.200 (substring, namespace, metric name or namespace elements only, regex may work but has not been fully tested)
              </td>
  		      </tr>
  		    </tbody>
  		  </table>
        <br>
        <input type="submit" value="Match metric">
      </form>
      </div>
  </div>

	</div>
	</div>
	</div>

<!-- END /match_metric block -->
{% endblock %}
